#include "util.h"
#include "event_def.h"
#include "imgupload.h"
#include "SendImage.h"

namespace ImgUpload
{
    UPLOAD_CB _upcb = NULL;
    bool Init(UPLOAD_CB cb){
        SendImage::init();
        _upcb = cb;
        return true;
    }

    void Clean(){
        SendImage::cleanup();
    }

    void AddImageServer(int queue, string ip, int port) {
		Log::debug("image server %s:%d %d", ip.c_str(), port, queue);
        SendImage::addSvr(queue, ip, port);
    }

    bool Upload(SPassEvent *e) {
        SendImage::addTask(e);
        return true;
    }
}